package com.action;
import java.util.List;

import com.business.SearchBusinessImpl;
import com.dao.Address;
import com.dao.Business;
import com.opensymphony.xwork2.ActionSupport;


public class ActionBusiness extends ActionSupport {

		//private static final long serialVersionUID = -3836941425899656987L;

		/**
	 * 
	 */
	    private static final long serialVersionUID = 1L;
		private Business business;
		private List<Business> businesses;
		private SearchBusinessImpl searchbusinessImpl;
		
		public ActionBusiness() {
			searchbusinessImpl = new SearchBusinessImpl();
		}
		
		
		public Business getBusiness() {
			return business;
		}


		public void setBusiness(Business business) {
			this.business = business;
		}


		public List<Business> getBusinesses() {
			return businesses;
		}


		public void setBusinesses(List<Business> businesses) {
			this.businesses = businesses;
		}


		public String search(){
			try{
			//addresses = businessIpml.listSearchAddress(address.getPostcode(),address.getStreet(),address.getTown());
			businesses = searchbusinessImpl.listSearchBusiness(business.getBusinessName(), business.getCodeSIC());
			
			}
			catch(Exception e){
				e.printStackTrace();
			}
			return SUCCESS;
		}
	}


